import React from 'react';
import Eye from './Eye.jsx';

import { Menu, Dropdown, Icon } from 'antd';

const menu = (
  <Menu>
    <Menu.Item key="0">
      <a href="javascript:;">分享图层</a>
    </Menu.Item>
    <Menu.Item key="1">
      <a href="javascript:;">删除图层</a>
    </Menu.Item>
    <Menu.Item key="2">
      <a href="javascript:;">重命名图层</a>
    </Menu.Item>
    <Menu.Item key="3">
      <a href="javascript:;">信息窗设置</a>
    </Menu.Item>
    <Menu.Item key="4">
      <a href="javascript:;">关联图层</a>
    </Menu.Item>
  </Menu>
);

class LayerTitle extends React.Component{
  static propTypes: {
    visible: PropTypes.bool.isRequired,
    setVisibilityFuc: PropTypes.func.isRequired,
    titleName: PropTypes.func.isRequired,
    totalNumber: PropTypes.number.isRequired
  }
  render() {
    return (
      <div className="title">
        <Eye visible={this.props.visible} onClickHandler={this.props.setVisibilityFuc} />
        <span className="main">{this.props.titleName}（{this.props.totalNumber}）</span>

        <div className="options">
          <a className="opt l1" href="javascript:;"></a>
          <a className="opt l2" href="javascript:;"></a>
          <Dropdown overlay={menu} trigger={['click']}>
            <Icon type="ellipsis" />
          </Dropdown>
        </div>     
      </div>
    );
  }
}; 

export default LayerTitle;







